package defaultproperty;

import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Map;
import java.util.Vector;

import pool.tablename.Pool;

import utility.ConvertToLower;
import utility.Input;

import dbmanager.Column;
import dbmanager.DBManager;
import dbmanager.GetIdName;
import file.SearchRecord;

public class Td_property_details implements Defaultproperty 
{
	Pool masterobject;
	DBManager database;
	GetIdName gid;
	Vector<Object> tdpllist =new Vector<Object>();
	Hashtable<Object, Object> table =new Hashtable<Object, Object>();
	
	public Hashtable<Object, Object> getAllproperties() 
	{
		Hashtable<Object, Object> propertyMap = new Hashtable<Object, Object>();
		
		for(int i=0;i<tdpllist.size();i++)
		{	
			table.putAll((Map<? extends Object, ? extends Object>) tdpllist.get(i));
			if(table.containsKey("pid"))
			{
				String key = table.get("pid").toString();
				if(propertyMap.containsKey(key))
				{
					int count = Integer.parseInt(propertyMap.get(key).toString());			
					propertyMap.put(key,Integer.toString(++count));
				}
				else
					propertyMap.put(key,"1");
			}
		}
		
		return propertyMap;
	}

	public void getResult(String value) 
	{
		
	}

	public void setObject(Object object, DBManager database) 
	{
		this.database = database; 
		this.masterobject =(Pool) object; 
		tdpllist = masterobject.getpropertyVector();
		gid =new GetIdName(database);
	}
	
	
}
